import request from '@/utils/request';

// 登录方法
export function login(username, password, captcha, uuid) {
  console.log(captcha, 'captcha');
  console.log(username, 'username');
  console.log(password, 'password');
  console.log(uuid, 'uuid');
  const data = {
    username,
    password,
    captcha,
    uuid,
  };
  return request({
    url: '/ssystem-api/admin/login',
    headers: {
      isToken: false,
      repeatSubmit: false,
    },
    method: 'post',
    data: data,
  });
}

export function Validate(data) {
  return request({
    url: '/ssystem-api/tob/Stores/Soldiers/Validate',
    headers: {
      isToken: false,
    },
    method: 'post',
    data: data,
  });
}
// tob/Stores/Soldiers/Validate
// 注册方法
export function register(data) {
  return request({
    url: '/ssystem-api/register',
    headers: {
      isToken: false,
    },
    method: 'post',
    data: data,
  });
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/ssystem-api/getInfo',
    method: 'get',
  });
}

// 退出方法
export function logout() {
  return request({
    url: '/ssystem-api/api/login/logout',
    method: 'post',
  });
}

/*
 * 最新代码调试接口数据
 * */
export function userlogin(data) {
  return request({
    url: '/ssystem-api/api/login/login',
    method: 'post',
    data: data,
    headers: {
      isToken: false,
      repeatSubmit: false,
    },
  });
}
// 获取验证码
export function sendCode(data) {
  return request({
    url: '/ssystem-api/api/index/sendCode',
    data: data,
    headers: {
      isToken: false,
      repeatSubmit: false,
    },
    method: 'post',
  });
}

// 修改密码
export function savePass(data) {
  return request({
    url: '/ssystem-api/api/account/savePass',
    data: data,
    // headers: {
    //   isToken: false,
    //   repeatSubmit: false
    // },
    method: 'post',
  });
}
